//引入数据库模块
const mysql = require("mysql");
var con = mysql.createConnection({
    host:"localhost",
    post:3306,
    user:"root",
    password:"",
    database:"database"
})

var insertsql = "insert into users values(?,?,?,?)";
var primarykey = (new Date()).getTime();
con.query(insertsql,[primarykey,"wangwu","35","female"],(err,result)=>{
    if(err){
        console.log(err);
    }
    else{
        console.log(result);
    }
});